<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no" />
		<title>速翔网络 - QQ技术：1424445608</title>
		<link rel="stylesheet" type="text/css" href="../css/aui.css" />
		<link rel="stylesheet" type="text/css" href="../css/ffxiang.css" />
		<link rel="stylesheet" type="text/css" href="../css/search.css" />
	</head>
	<body>
		<header class="aui-bar aui-bar-nav aui-bar-light fx-view-header" id="fx-header">
			<div class="aui-title" style="left:0rem; right: 0rem;">
				<div class="aui-searchbar" id="search">
					<div class="aui-searchbar-input aui-border-radius">
						<i class="aui-iconfont aui-icon-search"></i>
						<form>
							<input type="search" autoComplete='off' placeholder="搜索关键词" id="input">
						</form>
						<div class="aui-searchbar-clear-btn">
							<i class="aui-iconfont aui-icon-close"></i>
						</div>
					</div>
					<div class="aui-searchbar-btn" tapmode onclick="closes()">
						取消
					</div>
				</div>
			</div>
			<a class="aui-pull-right aui-btn"> </a>
		</header>
	</body>
	<script type="text/javascript" src="../script/zepto.min.js"></script>
	<script type="text/javascript" src="../script/fastclick.js"></script>
	<script type="text/javascript" src="../script/api.js"></script>
	<script type="text/javascript" src="../script/ffxiang.js"></script>
	<script type="text/javascript">
		var textsearch='',fan;
		apiready = function() {
			FastClick.attach(document.body)
			api.addEventListener({
			    name:'viewappear'
			}, function(ret, err){      
				_heibai(1)  
			});
			_heibai(1); 
			 
		 	
			openFrame('search', '', '1')
 
			$('.aui-searchbar-btn').css('margin-right', '0rem;')
 			$('.aui-searchbar-input').css('margin-left', '0.75rem')
 
//			if(textsearch){
//				$('.aui-searchbar-btn').css('margin-right', '0rem;')
//				$('.aui-searchbar-input').css('margin-left', '0.75rem')
//			}else{
//				$('#input').focus()
//				setTimeout(function(){
//					$('.aui-searchbar-btn').css('margin-right', '0rem;')
//					$('.aui-searchbar-input').css('margin-left', '0.75rem')
//				},300)
//			}
			// 回车搜索
			window.onkeydown = function(e) {
				//_msg(e.keyCode)
				if (e.keyCode == 13) {
					var q = $api.val($api.byId('input'));
					if (q) {
						var text = $('#input').val();
						key(text)
					}
					return false;
				}
			}
			// 监听夜间
			api.addEventListener({
			    name: 'yejian'
			}, function(ret, err) {
				if(ret){
					_yejians();
				}
			});
		}
		function c(){
			_close(fan)
			 
		}
		function closes(){
			_close(fan)
//			if(textsearch){
//				c()
//			}else{
//				$('.aui-searchbar-btn').css('margin-right', '-2.2rem')
//				$('.aui-searchbar-input').css('margin-left', '5.5rem')
//				setTimeout(function(){
//					c()
//				},300)
//			}
		}
		var asdasd = 0;
		// 点击关键词搜索
		function key(text) {
			 
			if (!text) {
				_msg('请输入搜索关键词')
				return;
			}
			$("#input").blur();
			$("#input").val(text)
			var searchText = $api.getStorage('searchText');
			if (searchText == undefined) {
				$api.setStorage('searchText', text);
			} else {
				//判断关键词是否存在
				var Cts = searchText.indexOf(text);
				if (Cts == -1) {
					searchText = text + ',' + searchText
					$api.setStorage('searchText', searchText);
				}
			}
		 
			if (!asdasd) {
				 
				api.execScript({
					frameName : 'search',
					script : 'lists("' + text + '")'
				});
				asdasd = 1;
				 
			} else {
				api.sendEvent({
					name : 'shifdakai',
					extra : {
						text : text,
					}
				});
			}
		}
		// 清空记录
		function del() {
			$api.rmStorage('searchText')
		}
		// 设置标题
		function title(text){
			$("#input").val(text)
			var searchText = $api.getStorage('searchText');
			if (searchText == undefined) {
				$api.setStorage('searchText', text);
			} else {
				//判断关键词是否存在
				var Cts = searchText.indexOf(text);
				if (Cts == -1) {
					searchText = text + ',' + searchText
					$api.setStorage('searchText', searchText);
				}
			}
		}
		function openFrame(url, header, footer, pageParam,useHi,bounces) {
	// 解析属性	消除点击300S 延时问题 tapmode
	api.parseTapmode();
	if(!useHi){
		useHi=false;
	}else{
		useHi=true;
	}
	var headerh;
	var footerh;
	if (header == 1) {
		headerh = 0;
	} else {
		var header = $api.byId('fx-header');
		$api.fixStatusBar(header);
		var headerPos = $api.offset(header);
		headerh = headerPos.h
	}
	var body_h = api.winHeight;
	if (footer == 1) {
		footerh = 0;
	} else {
		$api.fixTabBar($api.byId('fx-footer'))
		footerh = $api.offset($api.byId('fx-footer')).h;
	}
	if(bounces){
		bounces=false
	}else{
		bounces=true
	}
	//console.log(footerh)
	api.openFrame({
		name : url,
		url : html_win + url + '.html',
		bounces : true,
		//showProgress : true,
		reload : true,
		rect : {
			x : 0,
			y : headerh,
			w : 'auto',
			h : body_h - headerh
		},
		 
		 
		//useWKWebView : true,
		//historyGestureEnabled : true,
		//		vScrollBarEnabled : false,
		//		hScrollBarEnabled : false,
		pageParam : {w:headerh,textsearch:api.pageParam['text']},
	})
	 
	
}

	</script>
</html>